<?php

use think\Route;

Route::get('api/:version/banner/:id', 'api/:version.Banner/getBanner');

// Route::get('api/:version/theme', 'api/:version.Theme/getSimpleList');
// Route::get('api/:version/theme/:id', 'api/:version.Theme/getComplexOne');

Route::group('api/:version/theme', function () {
    Route::get('/', 'api/:version.Theme/getSimpleList');
    Route::get('/:id', 'api/:version.Theme/getComplexOne');
});


// Route::get('api/:version/product/by_category', 'api/:version.Product/getAllInCategory');
// Route::get('api/:version/product/:id', 'api/:version.Product/getOne', [], ['id'=> '\d+']);
// Route::get('api/:version/product/recent', 'api/:version.Product/getRecent');

// 路由分组
Route::group('api/:version/product', function () {
    Route::get('/by_category', 'api/:version.Product/getAllInCategory');
    Route::get('/:id', 'api/:version.Product/getOne', [], ['id'=> '\d+']);
    Route::get('/recent', 'api/:version.Product/getRecent');
});


Route::get('api/:version/category/all', 'api/:version.Category/getAllCategories');

Route::post('api/:version/token/user', 'api/:version.Token/getToken');

Route::post('api/:version/address', 'api/:version.Address/createOrUpdateAddress');

Route::group('api/:version/order', function () {
    Route::post('/', 'api/:version.Order/placeOrder');
});
